import 'package:flutter/material.dart';
import 'itemdata.dart';

class BlueItem extends StatelessWidget {
  final ItemData itemData;

  BlueItem(this.itemData);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(color: Colors.white),
      height: 64.0,
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          Container(
            margin: const EdgeInsets.only(left: 4.0,right: 16.0,top: 8.0,bottom: 8.0),
            height: 50.0,width: 50.0,
            decoration: BoxDecoration(shape: BoxShape.circle,color:itemData.color),
            child: Icon(
              itemData.icon,
              color: Colors.white,size: 28.0,
            ),
          ),
          Expanded(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Text(
                  itemData.title,
                  style: TextStyle(fontSize: 18.0, color: Colors.black,fontWeight: FontWeight.w500),
                  maxLines: 1,
                ),
                Padding(
                  padding: const EdgeInsets.only(top: 6.0),
                ),
                itemData.hassubIcon ? Row(
                  children: <Widget>[
                    Text(
                    itemData.subtitle,
                    style: TextStyle(fontSize: 14.0, color: Colors.grey),
                    maxLines: 1,
                  ),
                    Icon(Icons.message,color: Colors.grey,size: 14.0,),
                    Text('2',style: TextStyle(fontSize: 14.0,color: Colors.grey),)
                  ],
                ): Text(
                  itemData.subtitle,
                  style: TextStyle(fontSize: 14.0, color: Colors.grey),
                  maxLines: 1,
                ),
              ],
            ),
          )
        ],
      ),
    );
  }
}
